package com.yuantong.xyerp.core.api.exception;


import com.yuantong.xyerp.core.api.enums.EnumMsgCode;
import lombok.Getter;

/**
 * yt 异常类
 * @author czg
 *
 */
@Getter
public class YuantongException extends RuntimeException {

	private static final long serialVersionUID = 674329937380708750L;

	private String code;
	private String msg;
	private EnumMsgCode resultMsgCode;

	public YuantongException(String code, String msg) {
		super(msg);
		this.code = code;
		this.msg = msg;
	}

	public YuantongException(EnumMsgCode msgCode) {
		if ( msgCode == null ) {
			this.resultMsgCode = EnumMsgCode.MSG_SYS_ERROR;
		}
		else {
			this.resultMsgCode = msgCode;
		}
	}
}
